home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctj8404.arc
/
SEARCH1.BAS
< prev
next >
Wrap
BASIC Source File
|
1986-09-14
|
640b
|
25 lines
'
'$$$$$$$$$$$$$$
'Subroutine
'$$$$$$$$$$$$$$
'
' This is the sequential search subroutine.
' Input is the table in which to look up (ITABLE), the
' number of entries in the table (NTABLE), and the
' number whose index is to be found (JKEY). Output
' is the index (INDX) such that
' TABLE(INDX) = JKEY
'
' SEQUENTIAL SEARCH
'
8000 rem Start.
REM CMP cmp = 0
'
for i. = 1 to ntable
REM CMP cmp = cmp + 1.
if (itable(i.) = jkey) then indx = i.: return
next i.
'
return
'